﻿<Page:PhoneAwarePage x:Class="KouDai.Phone.MainPage"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:Page="clr-namespace:KouDai.Phone.Common"
                     xmlns:Share="clr-namespace:KouDai.Share"
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                     xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                     xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                     xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                     DataContext="{Binding Main,
                                           Source={StaticResource Locator}}"
                     FontFamily="{StaticResource PhoneFontFamilyNormal}"
                     FontSize="{StaticResource PhoneFontSizeNormal}"
                     Foreground="{StaticResource PhoneForegroundBrush}"
                     Orientation="Portrait"
                     SupportedOrientations="Portrait"
                     shell:SystemTray.IsVisible="True"
                     mc:Ignorable="d">
    <!--  LayoutRoot is the root grid where all page content is placed  -->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <ListBox x:Name="FirstList"
                 ItemsSource="{Binding Items}"
                 SelectionMode="Single">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Width="480" Height="137">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="173*" />
                            <ColumnDefinition Width="307*" />
                        </Grid.ColumnDefinitions>
                        <Image Source="{Binding ImageUrlForIphone}" Stretch="UniformToFill" />
                        <TextBlock Grid.Column="1"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Center"
                                   Foreground="#FF7B8138"
                                   Text="{Binding Name}"
                                   TextWrapping="Wrap" />
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="SelectionChanged">
                    <i:InvokeCommandAction Command="{Binding GoToDetailCommand, Mode=OneWay}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </ListBox>

    </Grid>

</Page:PhoneAwarePage>